//
//  IntroduceViewController.m
//  TenThousand
//
//  Created by 我的 on 16/6/27.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "IntroduceViewController.h"
#import "IntroduceTableViewCell.h"//猴钱宝介绍

@interface IntroduceViewController ()<UITableViewDelegate,UITableViewDataSource>

@end

#define titleArr @[@"高收益",@"高流动性",@"到账迅速",@"高安全性"]
#define subtitleArr @[@"年化率 1.00%-200.00%",@"随时买入随时卖出",@"T+1 到账",@"多种产品组合，分散风险"]

@implementation IntroduceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"萬钱宝介绍";
    [self introduceTableView];
    [self setExtraCellLineHidden:_introduceTableView];
    [self createLeft:[UIImage imageNamed:@"ZHSZicon_03"] leftClick:^{
        [self.navigationController popViewControllerAnimated:YES];
    } right:nil rightClick:nil];
}

- (UITableView *)introduceTableView{
    _introduceTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, Screen_Width, Screen_Height) style:UITableViewStylePlain];
    _introduceTableView.dataSource = self;
    _introduceTableView.delegate = self;
    [self.view addSubview:_introduceTableView];
    
    return _introduceTableView;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 4;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    IntroduceTableViewCell *introCell = [tableView dequeueReusableCellWithIdentifier:@"INTROTABLEVIEWCELL"];
    if (introCell == nil) {
        introCell = [[[NSBundle mainBundle] loadNibNamed:@"IntroduceTableViewCell" owner:nil options:nil]lastObject];
        
    }
    introCell.title.text = titleArr[indexPath.row];
    introCell.subtitle.text = subtitleArr[indexPath.row];
    introCell.selectionStyle = UITableViewCellSelectionStyleNone;
    return introCell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 100;
}


//隐藏多余的分割线
- (void)setExtraCellLineHidden: (UITableView *)tableView
{
    UIView *view = [UIView new];
    view.backgroundColor = [UIColor clearColor];
    [tableView setTableFooterView:view];
}


@end
